Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.uploadFile = function(o) {
    var r = (arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}).loading, u = void 0 === r || r, s = (0, 
    e.getRandomName)(o), a = (0, e.getFileDir)(s) + "/" + s, c = "https://lishanqr.oss-cn-hangzhou.aliyuncs.com/";
    return new Promise(function(e, r) {
        wx.uploadFile({
            url: c,
            filePath: o,
            name: "file",
            formData: {
                key: a,
                policy: t,
                OSSAccessKeyId: i,
                success_action_status: 200,
                signature: n
            },
            success: function(o) {
                u && wx.hideLoading(), o.statusCode >= 400 && (wx.showToast({
                    icon: "none",
                    title: "服务器错误"
                }), r(new Error("服务器错误"))), e(o);
            },
            fail: function(e) {
                u && wx.hideLoading(), r(e);
            }
        }).onProgressUpdate(function(e) {
            var o = e.progress;
            console.log(o), u && wx.showLoading({
                title: "正在上传" + o + "%"
            });
        });
    }).then(function() {
        return c + a;
    });
}, exports.updateQrcode = function(e, t) {
    return (0, o.put)("/api/qrcode/" + e, t);
}, exports.getQrcode = function(e) {
    return (0, o.get)("/api/qrcode/" + e);
}, exports.getHomeConfig = function() {
    return (0, o.get)("/api/config/home");
}, exports.getGroupConfig = function() {
    var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
    return (0, o.get)("/api/config/group/" + e);
};

var e = require("./util.js"), o = require("./fetch.js"), t = "eyJleHBpcmF0aW9uIjoiMjEyMS0wMS0wMVQxMjowMDowMC4wMDBaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF1dfQ==", n = "CyX+gEXmkR+Pd20bbbKCTLUXrP0=", i = "LTAI4Fv8K6cPYfa7bqMZv2Bd";